package homeWork.title4;
   /*
    （第4题）将"goOd gooD stUdy dAy dAy up"每个单词的首字母转换成大写其余还是小写字母
    (不许直接输出good good study day day up 要用代码实现)
     */

import java.util.ArrayList;

public class main {
    public static void main(String[] args) {
        ArrayList<String> list = new ArrayList<>();
        list.add("goOd");
        list.add("gooD");
        list.add("stUdy");
        list.add("dAy");
        list.add("dAy");
        list.add("up");
        for (int i = 0; i < list.size(); i++) {
            char[] arr = list.get(i).toCharArray();
            if (arr[0] >= 'a' && arr[0] <= 'z') {
                arr[0] -= 'a' - 'A';
            }
            for (int i1 = 1; i1 < arr.length; i1++) {
                if (arr[i1] >= 'A' && arr[i1] <= 'Z') {
                    arr[i1] += 32;
                }
            }
            System.out.println(arr);
        }
    }
}
